#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void CopyTxt()
{
	FILE* pf = fopen("data.txt", "r");
	if (pf == NULL)
	{
		perror("fopen read error");
		return;
	}

	FILE* pp = fopen("data_copy.txt", "w");
	if (pp == NULL)
	{
		perror("fopen write error");
		return;
	}

	int ch = 0;
	while ((ch = fgetc(pf)) != EOF)
	{
		fputc(ch, pp);
	}
	fclose(pf);
	fclose(pp);
	pf = NULL;
	pp = NULL;
}
int main()
{
	CopyTxt();
	return 0;
}